ifneq ($(strip $(TOOLPREFIX)),)
CROSS:=$(TOOLPREFIX)
endif

CC              =$(CROSS)gcc
STRIP           =$(CROSS)strip
STRIPFLAGS      = --strip-all --remove-section=.note --remove-section=.comment
STRIPCMD        =$(STRIP) $(STRIPFLAGS)

ifeq ($(strip $(PREFIX)),)
PREFIX:=`pwd`/_install
endif

CFLAGS += -MMD -O2 -Wall -g
CFLAGS += -I. 

ALL=wps_enrollee

all: $(ALL)

install: all
	for i in $(ALL); do cp $$i $(PREFIX)/$$i; done

OBJS = main.o wsc_supplicant.o l2_packet_linux.o  \
       EnrolleeSM.o randomlib.o crypto_internal.o \
       bignum.o sha256.o aes.o

wps_enrollee: $(OBJS)
	$(CC) -o wps_enrollee $(OBJS) $(LIBS)

clean:
	rm -f wps_enrollee *~ *.o *.d
